package redis

import (
	log "manager/collector/logger"
	"manager/store/redis/base"
)

var KV *Client
var prefix = "ebike:manager"

func Init(connectAddr, pwd string) func() {
	//connectAddr = "134.175.211.197:8379"
	//pwd = "ebike2023"
	KV = InitClient(&base.Options{
		Addr:       connectAddr,
		Password:   pwd,
		DB:         0,
		PoolSize:   30,
		MaxRetries: 5,
	})

	return func() {
		if err := KV.Close(); err != nil {
			log.Error(err)
		}
	}
}
